home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / faq-s.zip / WAITCALL.PAS < prev    next >
Pascal/Delphi Source File  |  1991-05-04  |  45KB  |  1,656 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,N-,L+,O+ }
  2. {$M 65500,0,0 }
  3.  
  4. unit waitcall;
  5.  
  6. interface
  7.  
  8. uses dos,crt,main,netnew,video,
  9.      gentypes,statret,configrt,modem,gensubs,subs1,subs2,mailret,overlay,
  10.      overret1,mainr1,mainr2,mainmenu,getlogin,userret,protocol,Graph3,drivers,mousedlg;
  11.  
  12. function waitforacall:boolean;
  13.  
  14. implementation
  15.  
  16. function waitforacall:boolean;
  17.   const statwindx=2;
  18.         statwindy=1;
  19.     firstcolx=17;
  20.     firstline=1;
  21.     secondcolx=41;
  22.         thirdcolx=66;
  23.  
  24.   var wscount      :integer;
  25.       modemoff     :boolean;
  26.       mustgetbaud  :boolean;
  27.       outf         :text;
  28.       screen       :screens;
  29.       screenblank  :boolean;
  30.       nl           :netmailrec;
  31.       nla          :netlistrec;
  32.       msg          :string[40];
  33.       anynum       :integer;
  34.       msgnum       :integer;
  35.       msgcount     :integer;
  36.       color1,color2,color3,
  37.       color4,color5,color6,
  38.       color7,color8,color9,
  39.       color10,color11,color12,
  40.       color13,color14,color15:integer;
  41.       blanker:minuterec;
  42.  
  43.     procedure cursor (b:boolean);
  44.     var r:registers;
  45.     begin
  46.       with r do begin
  47.         ah:=$01;
  48.         if not b then begin
  49.           ch:=$20; cl:=$20
  50.         end else begin
  51.         ch:=5; cl:=7
  52.         end
  53.       end;
  54.       intr ($10,r)
  55.     end;
  56.  
  57.     procedure col1;
  58.     begin
  59.     { window (statwindx+firstcolx,statwindy+firstline,80,25);
  60.     }end;
  61.  
  62.     procedure col2;
  63.     begin
  64.      { window (statwindx+secondcolx,statwindy+firstline,80,25);
  65.     }end;
  66.  
  67.     procedure col3;
  68.     begin
  69.      { window (statwindx+thirdcolx,statwindy+firstline,80,25);
  70.     }end;
  71.  
  72.    procedure seeknmfile (n:integer);
  73.    begin
  74.      seek (nmfile,n-1);
  75.    end;
  76.  
  77.    procedure seeknlifile (n:integer);
  78.    begin
  79.      seek (nlifile,n-1);
  80.    end;
  81.  
  82.       function numbbs:integer;
  83.    begin
  84.     numbbs:=filesize (nmfile);
  85.    end;
  86.  
  87.  
  88.    function numnetfiles:integer;
  89.    begin
  90.      numnetfiles:=filesize(nlifile)
  91.    end;
  92.  
  93. procedure delfile(laym:byte);
  94. var i    :integer;
  95.     n    :integer;
  96.     cnt  :integer;
  97.     c    :char;
  98.  
  99.  begin
  100.   n:=laym;
  101.   seeknlifile (n);
  102.   read (nlifile,nla);
  103.     for cnt:=n to numnetfiles-1 do
  104.      begin
  105.         seeknlifile (cnt+1);
  106.         read (nlifile,nla);
  107.         seeknlifile (cnt);
  108.         write (nlifile,nla)
  109.      end;
  110.    seeknlifile (numnetfiles);
  111.    truncate (nlifile);
  112.  end;
  113.  
  114.    procedure topwin;
  115.     begin;
  116.     window(3,7,79,14);
  117.     textcolor(statlinecolor);
  118.     end;
  119.  
  120.    procedure botwin;
  121.     begin;
  122.     window(3,18,79,22);
  123.     textcolor(splitcolor);
  124.     end;
  125.  
  126.   procedure maybewritestatus;
  127.   begin
  128.   msgcount:=msgcount+1;
  129.   anynum:=0;
  130.   repeat
  131.     color1:=color1+1;
  132.     color2:=color2+1;
  133.     color3:=color3+1;
  134.     color4:=color4+1;
  135.     color5:=color5+1;
  136.     color6:=color6+1;
  137.     color7:=color7+1;
  138.     color8:=color8+1;
  139.     color9:=color9+1;
  140.     color10:=color10+1;
  141.     color11:=color11+1;
  142.     color12:=color12+1;
  143.     color13:=color13+1;
  144.     color14:=color14+1;
  145.     color15:=color15+1;
  146.     if color1=16 then begin
  147.     color1:=color1-15;
  148.     end;
  149.     if color2=16 then begin
  150.     color2:=color2-15;
  151.     end;
  152.     if color3=16 then begin
  153.     color3:=color3-15;
  154.     end;
  155.     if color4=16 then begin
  156.     color4:=color4-15;
  157.     end;
  158.     if color5=16 then begin
  159.     color5:=color5-15;
  160.     end;
  161.     if color6=16 then begin
  162.     color6:=color6-15;
  163.     end;
  164.     if color7=16 then begin
  165.     color7:=color7-15;
  166.     end;
  167.     if color8=16 then begin
  168.     color8:=color8-15;
  169.     end;
  170.     if color9=16 then begin
  171.     color9:=color9-15;
  172.     end;
  173.     if color10=16 then begin
  174.     color10:=color10-15;
  175.     end;
  176.     if color11=16 then begin
  177.     color11:=color11-15;
  178.     end;
  179.     if color12=16 then begin
  180.     color12:=color12-15;
  181.     end;
  182.     if color13=16 then begin
  183.     color13:=color13-15;
  184.     end;
  185.     if color14=16 then begin
  186.     color14:=color14-15;
  187.     end;
  188.     if color15=16 then begin
  189.     color15:=color15-15;
  190.     end;
  191.     if not screenblank then begin
  192.     gotoxy (13,11);
  193.     textcolor (color1);
  194.     write (usr,'F');
  195.     textcolor (color2);
  196.     write (usr,'A');
  197.     textcolor (color3);
  198.     write (usr,'Q ');
  199.     textcolor (color4);
  200.     write (usr,copy (ver,1,1));
  201.     textcolor (color5);
  202.     write (usr,copy (ver,2,1));
  203.     textcolor (color6);
  204.     write (usr,copy (ver,3,1));
  205.     textcolor (color7);
  206.     write (usr,copy (ver,4,1)+' ');
  207.     textcolor (color8);
  208.     write (usr,copy (date,1,1));
  209.     textcolor (color9);
  210.     write (usr,copy (date,2,1));
  211.     textcolor (color10);
  212.     write (usr,copy (date,3,1));
  213.     textcolor (color11);
  214.     write (usr,copy (date,4,1));
  215.     textcolor (color12);
  216.     write (usr,copy (date,5,1));
  217.     textcolor (color13);
  218.     write (usr,copy (date,6,1));
  219.     textcolor (color14);
  220.     write (usr,copy (date,7,1));
  221.     textcolor (color15);
  222.     write (usr,copy (date,8,1));
  223.     end;
  224.     delay(100{80});
  225.     anynum:=anynum+1;
  226.     textcolor(normtopcolor);
  227.      until (carrier) or (keyhit) or (anynum>15);
  228.    if msgcount>15 then begin
  229.     textcolor(normtopcolor);
  230.         msgnum:=msgnum+1;
  231.         if msgnum>8 then begin
  232.           msg:='                                     ';
  233.           msgnum:=1;
  234.         end;
  235.         if msgnum=1 then begin
  236.           msg:=' FAQ Communications/BBS Software     ';
  237.           gotoxy(3,17);
  238.     textcolor(normtopcolor);
  239.          end;
  240.         if msgnum=2 then begin
  241.           msg:=' Author: The Firegod                 ';
  242.           gotoxy(3,17);
  243.     textcolor(normtopcolor);
  244.          end;
  245.         if msgnum=3 then begin
  246.           msg:=' Co-Author: The Witch Doctor         ';
  247.           gotoxy(3,17);
  248.     textcolor(normtopcolor);
  249.          end;
  250.         if msgnum=4 then begin
  251.           msg:=' (C)Copyright BaseTwo Software, 1991 ';
  252.           gotoxy(3,17);
  253.     textcolor(normtopcolor);
  254.          end;
  255.         if msgnum=5 then begin
  256.           msg:=' FAQ - The BBS Software of the 90''s  ';
  257.           gotoxy(3,17);
  258.     textcolor(normtopcolor);
  259.          end;
  260.         if msgnum=6 then begin
  261.           msg:=' FAQ has been brought to you by      ';
  262.           gotoxy(3,17);
  263.     textcolor(normtopcolor);
  264.          end;
  265.         if msgnum=7 then begin
  266.           msg:=' The FAQ Development Team            ';
  267.           gotoxy(3,17);
  268.     textcolor(normtopcolor);
  269.          end;
  270.         if msgnum=8 then begin
  271.           msg:=' Thank you for choosing FAQ!         ';
  272.           gotoxy(3,17);
  273.     textcolor(normtopcolor);
  274.          end;
  275.     if not screenblank then write (usr,msg);
  276.     textcolor(normtopcolor);
  277.     end;
  278.     wscount:=wscount+1;
  279.     if wscount>800 then begin
  280.       writestatus;
  281.       wscount:=0
  282.     end;
  283.   end;
  284.  
  285. Function checkforhayesreport:Boolean;
  286. Var n:longint;
  287.     q:lstr;
  288.     p,b:Integer;
  289.     k:Char;
  290.     bd,brate:baudratetype;
  291. Begin
  292.   delay (50);
  293.   q:='';k:=' ';
  294.   bd:=b110;
  295.   While (numchars>0) And (Length(q)<99) Do Begin
  296.     k:=getchar;q:=q+k;
  297.   End;
  298.   delay (500);
  299.   While (numchars>0) And (Length(q)<150) Do Begin
  300.     k:=getchar;
  301.     q:=q+k;
  302.   End;
  303.   If Not carrier Then exit;
  304.   if (Pos('ARQ',q)>0) or (Pos('MNP',q)>0) then arq:=true else arq:=false;
  305.   {if (defbaudrate=19200) or (defbaudrate=38400) and (lockport) then begin
  306.     writeln (usr,'[Locking the COM Port in 38400]');
  307.     bd:=b38400 end else} begin
  308.     If ((Pos('1',q)>0) or (Pos('CONNECT',q)>0)) and (defbaudrate>=300) Then bd:=b300;
  309.     If ((Pos('5',q)>0) or (Pos('CONNECT 1200',q)>0)) and (defbaudrate>=1200) Then bd:=b1200;
  310.     If ((Pos('10',q)>0) or (Pos('CONNECT 2400',q)>0)) and (defbaudrate>=2400) Then bd:=b2400;
  311.     If ((Pos('18',q)>0) or (Pos('CONNECT 4800',q)>0)) and (defbaudrate>=4800) Then bd:=b4800;
  312.     If ((Pos('13',q)>0) or (Pos('CONNECT 9600',q)>0)) and (defbaudrate>=9600) Then bd:=b19200;
  313.     If ((Pos('50',q)>0) or (Pos('CONNECT 19200',q)>0)) and (defbaudrate>=19200) Then bd:=b38400;
  314.     if bd=b110 then begin
  315.     if defbaudrate=300 then bd:=b300;
  316.     if defbaudrate=1200 then bd:=b1200;
  317.     if defbaudrate=2400 then bd:=b2400;
  318.     if defbaudrate=4800 then bd:=b4800;
  319.     if defbaudrate=9600 then bd:=b9600;
  320.     if defbaudrate=19200 then bd:=b19200;
  321.     if defbaudrate=38400 then bd:=b38400;
  322.    end;
  323.   end;
  324.   If (bd>b110) Then Begin
  325.     parity:=False;
  326.     baudrate:=baudarray[bd];
  327.     mustgetbaud:=False;
  328.     checkforhayesreport:=True;
  329.   End Else Checkforhayesreport:=False;
  330. End;
  331.  
  332. (***
  333.  
  334.  {function checkforhayesreport:boolean;  { Looks for CONNECT 300 }
  335.   var n:longint;
  336.       q:sstr;
  337.       p,b:integer;
  338.       k:char;
  339.       brate:baudratetype;
  340.   const lookfor:sstr=#13#10'CONNECT ';
  341.   begin
  342.     checkforhayesreport:=false;
  343.     if numchars=0 then exit;
  344.     p:=1;
  345.     q:='';
  346.     b:=0;
  347.     repeat
  348.       n:=now;
  349.       repeat until (now>n+1) or (numchars>0);
  350.       if numchars=0 then exit else k:=getchar;
  351.       if (k=#13) and (length(q)>0) then begin
  352.         val (q,b,p);
  353.         brate:=b300;
  354.         while (brate<=b38400) and
  355.               ((b<>baudarray[brate])
  356.                 or (not (brate in supportedrates)))
  357.               do brate:=succ(brate);
  358.         if brate<=b38400 then begin
  359.           parity:=false;
  360.           baudrate:=b;
  361.           checkforhayesreport:=true;
  362.           mustgetbaud:=false;
  363.           n:=now;
  364.           repeat until carrier or (now>n+1)
  365.         end;
  366.         exit
  367.       end;
  368.       if p>length(lookfor) then q:=q+k else begin
  369.         if k=lookfor[p] then p:=p+1 else begin
  370.           b:=b+1;
  371.           if b=2 then exit
  372.         end
  373.       end
  374.     until false
  375.   end;}
  376.  
  377. ***)
  378.  
  379. { procedure receivecall;
  380.   var b:byte;
  381.       timeout,autoswitch:integer;
  382.       k:char;
  383.       brate:baudratetype;
  384.  
  385.     procedure nextrate (var b:baudratetype);
  386.     var ob:baudratetype;
  387.     begin
  388.       ob:=b;
  389.       repeat
  390.         b:=succ(b);
  391.         if b>b38400 then b:=b300;
  392.         if b=ob then exit
  393.       until b in supportedrates
  394.     end;
  395.  
  396.     procedure disconnect;
  397.     begin
  398.       if (carrier or local) then hangupmodem;
  399.       baudrate:=defbaudrate;
  400.       parity:=false;
  401.       setparam(usecom,baudrate,parity);
  402.       setupmodem
  403.     end;
  404.  
  405.     function seconds:integer;
  406.     var r:registers;
  407.     begin
  408.       r.ah:=$2c;
  409.       intr ($21,r);
  410.       seconds:=r.dh
  411.     end; }
  412.  
  413.   procedure receivecall;
  414.   var b:byte;
  415.       timeout,autoswitch:integer;
  416.       k:char;
  417.       brate:baudratetype;
  418.       matrix:anystr;
  419.       joemam:anystr;
  420.       brow:integer;
  421.       lowbaud:integer;
  422.  
  423.     procedure nextrate (var b:baudratetype);
  424.     var ob:baudratetype;
  425.     begin
  426.       ob:=b;
  427.       repeat
  428.         b:=succ(b);
  429.         if b>b38400 then b:=b300;
  430.         if b=ob then exit
  431.       until b in supportedrates
  432.     end;
  433.  
  434.     procedure disconnect;
  435.     begin
  436.       if carrier then hangupmodem;
  437.       baudrate:=defbaudrate;
  438.       parity:=false;
  439.       setparam (usecom,baudrate,parity);
  440.       setupmodem
  441.     end;
  442.  
  443.     function seconds:integer;
  444.     var r:registers;
  445.     begin
  446.       r.ah:=$2c;
  447.       intr ($21,r);
  448.       seconds:=r.dh
  449.     end;
  450.  
  451.   label abort,connected;
  452.   var return:string;
  453.   begin
  454.     local:=false;
  455.     online:=false;
  456.     textcolor (normbotcolor);
  457.     window (1,1,80,25);
  458.     clrscr;
  459.     window (1,1,80,24);
  460.     if checkforhayesreport then goto connected;
  461.     if not mustgetbaud then goto connected;
  462.     writeln;
  463.     brate:=b300;
  464.     parity:=false;
  465.     timeout:=timer+2;
  466.     repeat
  467.       nextrate (brate);
  468.       baudrate:=baudarray[brate];
  469.       textcolor (outlockcolor);
  470.       textbackground (0);
  471.       writeln (usr,^M^J'Trying [',baudrate,']:');
  472.       online:=true;
  473.         if numchars=0 then begin
  474.         return:=^B+^M+'-Press Return';
  475.         for b:=1 to length(return) do begin
  476.         sendchar (return[b]); write (usr,return[b]);
  477.         if  numchars>0 then b:=length(return);
  478.         end;
  479.         end;
  480.       while numchars>0 do k:=getchar;
  481.       autoswitch:=seconds+3;
  482.       if autoswitch>59 then autoswitch:=autoswitch-60;
  483.       repeat until (not carrier) or (numchars>0) or (keyhit) or
  484.                    (timer>=timeout) or (autoswitch=seconds);
  485.       if timer>=timeout then hangupmodem;
  486.       if not carrier then goto abort;
  487.       if keyhit
  488.         then
  489.           begin
  490.             k:=bioskey;
  491.             case upcase(k) of
  492.               #13:goto connected;
  493.               'D':goto abort;
  494.             end
  495.           end
  496.         else
  497.           begin
  498.             if numchars>0 then begin
  499.               b:=ord(getchar);
  500.             end else b:=0;
  501.             if b<>13
  502.               then if b=141
  503.                 then parity:=true
  504.                 else
  505.                   begin
  506.                     delay (200);
  507.                     while numchars>0 do b:=ord(getchar)
  508.                   end
  509.           end
  510.     until (b=13) or (b=141) or (timer>timeout);
  511.     if timer<=timeout then begin
  512.       connected:
  513.       setparam (usecom,baudrate,parity);
  514.       if parity
  515.         then baudstr:='E,7'
  516.         else baudstr:='N,8';
  517.       baudstr:=strr(baudrate)+','+baudstr+',1';
  518.       online:=true;
  519.       urec.config:=[lowercase,linefeeds,eightycols];
  520.       newcalls:=newcalls+1;
  521.       delay (750);
  522.       cursor (true);
  523.       if carrier then exit
  524.     end;
  525.     abort:
  526.     disconnect
  527.   end;
  528.  
  529.   procedure exitprog;
  530.   Begin
  531.     sendmodemstr ('~~ATS0=0Q0M1V1X7|',true);
  532.     dontanswer;
  533.     TextMode(80);
  534.     window (1,1,80,25);
  535.     clrscr;
  536.     textbackground (0);
  537.     textcolor (normbotcolor);
  538.     gotoxy (1,1);
  539.     writeln (usr,'  ┌──────────────────────────────────────────────────────────────────────────┐');
  540.     gotoxy (1,2);
  541.     write   (usr,'  │');
  542.     textcolor (outlockcolor);
  543.     write   (usr,'                          FAQ '+ver+' - '+date+'                             ');
  544.     textcolor (normbotcolor);
  545.     writeln (usr,'│');
  546.     textcolor (normbotcolor);
  547.     gotoxy (1,3);
  548.     write   (usr,'  │');
  549.     textcolor (normtopcolor);
  550.     write   (usr,'                  FAQ "F-A-Q" - Functional and Quick.                     ');
  551.     textcolor (normbotcolor);
  552.     writeln (usr,'│');
  553.     textcolor (normbotcolor);
  554.     gotoxy (1,4);
  555.     write   (usr,'  │');
  556.     textcolor (outlockcolor);
  557.     write   (usr,'                Authors - The Firegod and The Witch Doctor                ');
  558.     textcolor (normbotcolor);
  559.     writeln (usr,'│');
  560.     gotoxy (1,5);
  561.     write   (usr,'  │');
  562.     textcolor (outlockcolor);
  563.     write   (usr,'                          of BaseTwo Software                             ');
  564.     textcolor (normbotcolor);
  565.     writeln (usr,'│');
  566.     textcolor (normbotcolor);
  567.     gotoxy (1,6);
  568.     writeln (usr,'  └──────────────────────────────────────────────────────────────────────────┘');
  569.   ensureclosed;
  570.   ClosePort;
  571.   ansicolor (7);
  572.   textcolor (7);
  573.   halt (4);
  574.   end;
  575.  
  576.   procedure checkday;
  577.   begin
  578.     if lastdayup<>datestr(now) then begin
  579.       lastdayup:=datestr(now);
  580.       numdaysup:=numdaysup+1;
  581.       callstoday:=0;
  582.       writestatus
  583.     end
  584.   end;
  585.  
  586.   procedure useredit;
  587.   {$M 8192,0,0}           { Leave memory for child process }
  588. var
  589.   Command: string[127];
  590.  
  591. begin
  592.     Command:=('Uedit');
  593.     begin
  594.       SwapVectors;
  595.       Exec(GetEnv('COMSPEC'), '/C ' + Command);
  596.       SwapVectors;
  597.     end;
  598.    TextMode(80);
  599.    Clrscr;
  600. end;
  601.  
  602.  procedure Futil;
  603. var
  604.   Command2: string[127];
  605.  
  606. begin
  607.     TextMode(80);
  608.     ClrScr;
  609.     Command2:=('Futil');
  610.     begin
  611.       SwapVectors;
  612.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  613.       SwapVectors;
  614.     end;
  615.    TextMode(80);
  616.    Clrscr;
  617. end;
  618.  
  619.  procedure Run_Config;
  620. var
  621.   Command2: string[127];
  622.  
  623. begin
  624.     TextMode(80);
  625.     ClrScr;
  626.     Command2:=('SETUP');
  627.     begin
  628.       SwapVectors;
  629.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  630.       SwapVectors;
  631.     end;
  632.    TextMode(80);
  633.    Clrscr;
  634. end;
  635.  
  636.  procedure Run_Prot_Config;
  637. var
  638.   Command2: string[127];
  639.  
  640. begin
  641.     TextMode(80);
  642.     ClrScr;
  643.     Command2:=('Protedit');
  644.     begin
  645.       SwapVectors;
  646.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  647.       SwapVectors;
  648.     end;
  649.    TextMode(80);
  650.    Clrscr;
  651. end;
  652.  
  653.  procedure Run_Sound;
  654. var
  655.   Command2: string[127];
  656.  
  657. begin
  658.     TextMode(80);
  659.     ClrScr;
  660.     Command2:=('Sound.Bat');
  661.     begin
  662.       SwapVectors;
  663.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  664.       SwapVectors;
  665.     end;
  666.    TextMode(80);
  667.    Clrscr;
  668. end;
  669.  
  670.   procedure dotimedevent;
  671.   var tf:text;
  672.   begin
  673.     window (1,1,80,25);
  674.     clrscr;
  675.     writeln (usr,'Executing timed event: ',eventbatch);
  676.     writeln (usr);
  677.     assign (tf,'Door.bat');
  678.     rewrite (tf);
  679.     writeln (tf,eventbatch);
  680.     textclose (tf);
  681.     timedeventdate:=datestr(now);
  682.     ensureclosed;
  683.   ansicolor (7);
  684.   textcolor (7);
  685.     halt (3)
  686.   end;
  687.  
  688.   procedure donetworkevent;
  689.   var tf:text;
  690.   begin
  691.     window (1,1,80,25);
  692.     clrscr;
  693.     writeln (usr,'Executing network call: ',netstart);
  694.     writeln (usr);
  695.     repeat
  696.     if usemouse then hidemouse;
  697.     NewNetSend;
  698.     until (timestr(now)=netend);
  699.   end;
  700.  
  701.   function statusscreen:char;
  702.  
  703.     procedure percent (r1,r2:real);
  704.     begin
  705.       if (r2<1) then exit;
  706.       r2:=round((r1/r2)*1000)/10;
  707.       writeln (usr,r2:0:1,'%')
  708.     end;
  709.  
  710.     procedure writefreespace;
  711.     var r:registers; tempfree:real; lp:integer; total:real;
  712.         csize:real;
  713.  
  714.       function unsigned (i:integer):real;
  715.       begin
  716.         if i>=0 then unsigned:=i else unsigned:=65536.0+i
  717.       end;
  718.  
  719.     begin
  720.     total:=0;
  721.     for lp:=3 to 15 do begin
  722.  
  723.       r.ah:=$1c;
  724.       r.dl:=lp;
  725.       intr ($21,r);
  726.  
  727.       if mem[r.ds:r.bx]=$f8 then begin
  728.           r.ah:=$36;
  729.           r.dl:=lp;
  730.           intr ($21,r);
  731.           csize:=unsigned(r.ax)*unsigned(r.cx);
  732.           tempfree:=(csize*unsigned(r.bx))/1000;
  733.           total:=total+tempfree/1000;
  734.           gotoxy(67,5);
  735.                   textcolor(normtopcolor);
  736.           write(usr,streal(total)+' meg(s)');
  737.           end;
  738.  
  739.       end;
  740.     end;
  741.  
  742.     procedure drawstatus;
  743.     var totalidle,totalup,totalmins,r:real;
  744.         tmp,nettmp:integer;
  745.  
  746.     begin
  747.       if screenblank then exit;
  748.      {col1;}
  749.       tmp:=timetillevent;
  750.       if (tmp<=30) then begin
  751.         gotoxy (4,18);
  752.         write (usr,'Event scheduled in ',tmp,' min.');
  753.         if (tmp<=5) then begin
  754.           dontanswer;
  755.           if tmp<=2 then dotimedevent;
  756.         end
  757.       end;
  758.       nettmp:=timenetworkevent;
  759.       if (nettmp<=30) and (usenet) then begin
  760.         gotoxy (4,19);
  761.         write (usr,'Network Event scheduled in ',nettmp,' min.');
  762.         if (nettmp<=5) and (usenet) then begin
  763.           dontanswer;
  764.           if (nettmp<=2) and (usenet) then donetworkevent;
  765.         end
  766.       end;
  767.       if carrier or keyhit then exit;
  768.       gotoxy (4,20);
  769.       if getenv ('DSZLOG')<>dszlogname then write (usr,'DSZ Log not set') else
  770.       write(usr,'DSZ Log: '+dszlogname);
  771.       gotoxy (11,22); write(usr,timestr(now));
  772.       gotoxy (20,22); write(usr,datestr(now));
  773.       gotoxy (14,13); write(usr,netnum);
  774.       gotoxy (23,15); if usenet then write(usr,'Yes') else write(usr,'No ');
  775.       gotoxy (18,4);
  776.       writeln (usr,callstoday);
  777.       gotoxy (42,5);
  778.       tmp:=elapsedtime (numminsidle);
  779.       write (usr,tmp);
  780.       writefreespace;
  781.       gotoxy (67,4);
  782.       writeln (usr,numdaysup);
  783.       r:=round(10*numcallers/numdaysup)/10;
  784.       gotoxy (18,5);
  785.       writeln (usr,r:0:1);
  786. {      col2;
  787.       gotoxy (1,3);
  788.       totalidle:=numminsidle.total+elapsedtime(numminsidle);
  789.       writeln (usr,totalidle:0:0);
  790.       totalup:=totalidle+numminsused.total;
  791.       writeln (usr,totalup:0:0);
  792.       totalmins:=1440.0*(numdaysup-1.0)+timer;
  793.       if (totalup<1) or (totalmins<1) then exit;
  794.       percent (numminsused.total,totalmins);
  795.       percent (numminsxfer.total,totalmins);
  796.       percent (totalidle,totalmins);
  797.       percent (totalup,totalmins);
  798.       percent (totalmins-totalup,totalmins);}
  799.      {col1;}
  800.       gotoxy (1,1);
  801.       maybewritestatus
  802.     end;
  803.  
  804.     procedure writeavail;
  805.     var ChatM:sstr; m:sstr;
  806.     begin
  807.       gotoxy (63,22);
  808. {TEST for chat
  809.       ChatM:=Timestr(Now);
  810.       If Chatm=Availtime then SysopAvailstr='YES';}
  811.       m:=sysopavailstr;
  812.       while length(m)<13 do m:=m+' ';
  813.       write (usr,m);
  814.       gotoxy (1,1)
  815.     end;
  816.  
  817.   var cnt,numsmail:integer;
  818.       k:char;
  819.       tmp:mstr;
  820.       b:byte;
  821.       done:boolean;
  822.  
  823.     function shouldexit:boolean;
  824.     begin
  825.       shouldexit:=done or carrier
  826.     end;
  827.  
  828.     procedure handlekey (k:char; beforeabout:boolean);
  829.     begin
  830.       b:=ord(k)-128;
  831.       case b of
  832.         availtogglechar:begin
  833.           toggleavail;
  834.           if not beforeabout then writeavail
  835.         end;
  836.         35:sendmodemstr ('+++~~~ATH|',true);
  837.         48,59,60,61,62,63,64,65,66,67,68:begin
  838.           done:=true;
  839.           statusscreen:=k
  840.         end
  841.       end
  842.     end;
  843.  
  844.     procedure writeboardname;
  845.     var xcoord:integer; nm:string[50];
  846.     begin
  847.     nm:=longname;
  848.     xcoord:=39-(length(nm) div 2);
  849.         textcolor (normtopcolor);
  850.     gotoxy(xcoord,24); write(usr,nm);
  851.     end;
  852.  
  853.     function interrupted (beforeabout:boolean):boolean;
  854.     begin
  855.       if keyhit then begin
  856.         k:=bioskey;
  857.         handlekey (k,beforeabout)
  858.       end;
  859.       done:=done or carrier;
  860.       interrupted:=done
  861.     end;
  862.  
  863.     procedure sendstring (x:lstr);
  864.     var cnt:integer;
  865.         k:char;
  866.     begin
  867.       for cnt:=1 to length(x) do begin
  868.         sendchar(x[cnt]);
  869.         delay (20);
  870.       end;
  871.       delay (50);
  872.       while numchars>0 do k:=getchar;
  873.       clearoutput;
  874.       clearinput;
  875.    end;
  876. procedure phonesringing;
  877.     begin
  878.        {col2;}
  879.     gotoxy(37,22);
  880.           textcolor (normtopcolor);
  881.         write(usr,'Answering Call  ');
  882.       sendstring ('  ATA'#13)
  883.     end;
  884.  
  885.   Procedure connectcode(k:Char);
  886.   Var timer:word Absolute $40:$6c;
  887.       t:word;
  888.       k2:Char;
  889.       bd:baudratetype;
  890.   Begin
  891.     t:=timer+18;
  892.     Repeat Until (timer>t) Or carrier Or (numchars>0);
  893.     k2:=getchar;{ Will be #0 if no chars }
  894.     Case k Of
  895.      '1' : Case k2 Of
  896.              #0 :bd:=b300;
  897.              '0' :bd:=b2400;
  898.              '6' :bd:=b9600;
  899.              Else exit
  900.             End;
  901.      '5' :bd:=b1200;
  902.      Else exit
  903.     End;
  904.     If bd In supportedrates Then Begin
  905.       parity:=False;
  906.       baudrate:=baudarray[bd];
  907.       mustgetbaud:=False;
  908.       t:=timer+18;
  909.       Repeat Until carrier Or (timer>t)
  910.     End;
  911.   End;
  912.  
  913.   var setlog:string[50];
  914.       i,iiii:byte;
  915.   begin
  916.     while numchars>0 do k:=getchar;
  917.     clearoutput;
  918.     clearinput;
  919.     statusscreen:=#0;
  920.     done:=false;
  921.     window (1,1,80,25);
  922.     textcolor (normbotcolor);
  923.     clrscr;
  924.     {setcursor(cursoroff);}cursor(false);
  925.     window (statwindx,statwindy,80,25);
  926.     if elapsedtime (blanker)>=1 then screenblank:=true;
  927.     if not screenblank then begin
  928.     gotoxy (1,1);
  929. {writeln(usr,'┌─────────────────────────────────────┬────────────────────────────────────┐');
  930. write  (usr,'│ ');
  931. textcolor (outlockcolor);
  932. write  (usr,'          ');
  933. textcolor (normbotcolor);
  934. write  (usr,'                          │');
  935. textcolor (outlockcolor);
  936. write  (usr,'             ');
  937. textcolor (normbotcolor);
  938. writeln(usr,'                       │');
  939. writeln(usr,'├────────────────────────┬────────────┴───────────┬────────────────────────┤');
  940. write  (usr,'│ ');
  941. textcolor (outlockcolor);
  942. write  (usr,'            ');
  943. textcolor (normbotcolor);
  944. write  (usr,'           │');
  945. textcolor (outlockcolor);
  946. write  (usr,'            ');
  947. textcolor (normbotcolor);
  948. write  (usr,'            │');
  949. textcolor (outlockcolor);
  950. write  (usr,'            ');
  951. textcolor (normbotcolor);
  952. writeln(usr,'            │');
  953. write  (usr,'│ ');
  954. textcolor (outlockcolor);
  955. write  (usr,'            ');
  956. textcolor (normbotcolor);
  957. write  (usr,'           │');
  958. textcolor (outlockcolor);
  959. write  (usr,'            ');
  960. textcolor (normbotcolor);
  961. write  (usr,'            │');
  962. textcolor (outlockcolor);
  963. write  (usr,'            ');
  964. textcolor (normbotcolor);
  965. writeln(usr,'            │');
  966. write  (usr,'│ ');
  967. textcolor (outlockcolor);
  968. write  (usr,'            ');
  969. textcolor (normbotcolor);
  970. write  (usr,'           │');
  971. textcolor (outlockcolor);
  972. write  (usr,'            ');
  973. textcolor (normbotcolor);
  974. write  (usr,'            │');
  975. textcolor (outlockcolor);
  976. write  (usr,'            ');
  977. textcolor (normbotcolor);
  978. writeln(usr,'            │');
  979. write  (usr,'│ ');
  980. textcolor (outlockcolor);
  981. write  (usr,'            ');
  982. textcolor (normbotcolor);
  983. write  (usr,'           │');
  984. textcolor (outlockcolor);
  985. write  (usr,'            ');
  986. textcolor (normbotcolor);
  987. write  (usr,'            │');
  988. textcolor (outlockcolor);
  989. write  (usr,'            ');
  990. textcolor (normbotcolor);
  991. writeln(usr,'            │');
  992. writeln(usr,'├────────────────────────┴────────────┬───────────┴────────────────────────┤');
  993. write  (usr,'│ ');
  994. textcolor (outlockcolor);
  995. write  (usr,'           ');
  996. textcolor (normbotcolor);
  997. write  (usr,'                         │');
  998. if outlockcolor>8 then
  999. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1000. write  (usr,'     ');
  1001. textcolor (normbotcolor);
  1002. write  (usr,'  ');
  1003. textcolor (outlockcolor);
  1004. write  (usr,'                             ');
  1005. textcolor (normbotcolor);
  1006. writeln(usr,'│');
  1007. write  (usr,'├─────────────────────────────────────┤');
  1008. if outlockcolor>8 then
  1009. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1010. write  (usr,'     ');
  1011. textcolor (normbotcolor);
  1012. write  (usr,'  ');
  1013. textcolor (outlockcolor);
  1014. write  (usr,'                             ');
  1015. textcolor (normbotcolor);
  1016. writeln(usr,'│');
  1017. write  (usr,'│ ');
  1018. textcolor (outlockcolor);
  1019. write  (usr,'       ');
  1020. textcolor (normbotcolor);
  1021. write  (usr,'                             │');
  1022. if outlockcolor>8 then
  1023. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1024. write  (usr,'     ');
  1025. textcolor (normbotcolor);
  1026. write  (usr,'  ');
  1027. textcolor (outlockcolor);
  1028. write  (usr,'                             ');
  1029. textcolor (normbotcolor);
  1030. writeln(usr,'│');
  1031. write  (usr,'├─────────────────────────────────────┤');
  1032. if outlockcolor>8 then
  1033. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1034. write  (usr,'     ');
  1035. textcolor (normbotcolor);
  1036. write  (usr,'  ');
  1037. textcolor (outlockcolor);
  1038. write  (usr,'                             ');
  1039. textcolor (normbotcolor);
  1040. writeln(usr,'│');
  1041. write  (usr,'│ ');
  1042. textcolor (outlockcolor);
  1043. write  (usr,'        ');
  1044. textcolor (normbotcolor);
  1045. write  (usr,'                            │');
  1046. if outlockcolor>8 then
  1047. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1048. write  (usr,'     ');
  1049. textcolor (normbotcolor);
  1050. write  (usr,'  ');
  1051. textcolor (outlockcolor);
  1052. write  (usr,'                             ');
  1053. textcolor (normbotcolor);
  1054. writeln(usr,'│');
  1055. write  (usr,'├─────────────────────────────────────┤');
  1056. if outlockcolor>8 then
  1057. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1058. write  (usr,'     ');
  1059. textcolor (normbotcolor);
  1060. write  (usr,'  ');
  1061. textcolor (outlockcolor);
  1062. write  (usr,'                             ');
  1063. textcolor (normbotcolor);
  1064. writeln(usr,'│');
  1065. write  (usr,'│                                     │');
  1066. if outlockcolor>8 then
  1067. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1068. write  (usr,'     ');
  1069. textcolor (normbotcolor);
  1070. write  (usr,'  ');
  1071. textcolor (outlockcolor);
  1072. write  (usr,'                             ');
  1073. textcolor (normbotcolor);
  1074. writeln(usr,'│');
  1075. write  (usr,'├─────────────────────────────────────┤');
  1076. if outlockcolor>8 then
  1077. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1078. write  (usr,'     ');
  1079. textcolor (normbotcolor);
  1080. write  (usr,'  ');
  1081. textcolor (outlockcolor);
  1082. write  (usr,'                             ');
  1083. textcolor (normbotcolor);
  1084. writeln(usr,'│');
  1085. write  (usr,'│                                     │');
  1086. if outlockcolor>8 then
  1087. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1088. write  (usr,'     ');
  1089. textcolor (normbotcolor);
  1090. write  (usr,'  ');
  1091. textcolor (outlockcolor);
  1092. write  (usr,'                             ');
  1093. textcolor (normbotcolor);
  1094. writeln(usr,'│');
  1095. write  (usr,'│                                     │');
  1096. if outlockcolor>8 then
  1097. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1098. write  (usr,'     ');
  1099. textcolor (normbotcolor);
  1100. write  (usr,'  ');
  1101. textcolor (outlockcolor);
  1102. write  (usr,'                             ');
  1103. textcolor (normbotcolor);
  1104. writeln(usr,'│');
  1105. write  (usr,'│                                     │');
  1106. if outlockcolor>8 then
  1107. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1108. write  (usr,'     ');
  1109. textcolor (normbotcolor);
  1110. write  (usr,'  ');
  1111. textcolor (outlockcolor);
  1112. write  (usr,'                             ');
  1113. textcolor (normbotcolor);
  1114. writeln(usr,'│');
  1115. write  (usr,'│                                     │');
  1116. if outlockcolor>8 then
  1117. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1118. write  (usr,'     ');
  1119. textcolor (normbotcolor);
  1120. write  (usr,'  ');
  1121. textcolor (outlockcolor);
  1122. write  (usr,'                             ');
  1123. textcolor (normbotcolor);
  1124. writeln(usr,'│');
  1125. writeln(usr,'├──────────────────────────┬──────────┴──────────────┬─────────────────────┤');
  1126. write  (usr,'│ ');
  1127. textcolor (outlockcolor);
  1128. write  (usr,'     ');
  1129. textcolor (normbotcolor);
  1130. write  (usr,'                    │');
  1131. textcolor (outlockcolor);
  1132. write  (usr,'     ');
  1133. textcolor (normbotcolor);
  1134. write  (usr,'                    │');
  1135. textcolor (outlockcolor);
  1136. write  (usr,'     ');
  1137. textcolor (normbotcolor);
  1138. writeln(usr,'                │');
  1139. writeln(usr,'├──────────────────────────┴─────────────────────────┴─────────────────────┤');
  1140. writeln(usr,'│                                                                          │');
  1141. write  (usr,'└──────────────────────────────────────────────────────────────────────────┘');
  1142. gotoxy (1,1);}
  1143. writeln(usr,'┌─────────────────────────────────────┬────────────────────────────────────┐');
  1144. write  (usr,'│ ');
  1145. textcolor (outlockcolor);
  1146. write  (usr,'Registered');
  1147. textcolor (normbotcolor);
  1148. write  (usr,':                         │');
  1149. textcolor (outlockcolor);
  1150. write  (usr,'Serial Number');
  1151. textcolor (normbotcolor);
  1152. writeln(usr,':                      │');
  1153. writeln(usr,'├────────────────────────┬────────────┴───────────┬────────────────────────┤');
  1154. write  (usr,'│ ');
  1155. textcolor (outlockcolor);
  1156. write  (usr,'Calls Today ');
  1157. textcolor (normbotcolor);
  1158. write  (usr,':          │');
  1159. textcolor (outlockcolor);
  1160. write  (usr,'Total Calls ');
  1161. textcolor (normbotcolor);
  1162. write  (usr,':           │');
  1163. textcolor (outlockcolor);
  1164. write  (usr,'Total Days  ');
  1165. textcolor (normbotcolor);
  1166. writeln(usr,':           │');
  1167. write  (usr,'│ ');
  1168. textcolor (outlockcolor);
  1169. write  (usr,'Calls / Day ');
  1170. textcolor (normbotcolor);
  1171. write  (usr,':          │');
  1172. textcolor (outlockcolor);
  1173. write  (usr,'Mins Idle   ');
  1174. textcolor (normbotcolor);
  1175. write  (usr,':           │');
  1176. textcolor (outlockcolor);
  1177. write  (usr,'Free Space  ');
  1178. textcolor (normbotcolor);
  1179. writeln(usr,':           │');
  1180. write  (usr,'│ ');
  1181. textcolor (outlockcolor);
  1182. write  (usr,'New Calls   ');
  1183. textcolor (normbotcolor);
  1184. write  (usr,':          │');
  1185. textcolor (outlockcolor);
  1186. write  (usr,'New Posts   ');
  1187. textcolor (normbotcolor);
  1188. write  (usr,':           │');
  1189. textcolor (outlockcolor);
  1190. write  (usr,'New Uploads ');
  1191. textcolor (normbotcolor);
  1192. writeln(usr,':           │');
  1193. write  (usr,'│ ');
  1194. textcolor (outlockcolor);
  1195. write  (usr,'New Feedback');
  1196. textcolor (normbotcolor);
  1197. write  (usr,':          │');
  1198. textcolor (outlockcolor);
  1199. write  (usr,'New Mail    ');
  1200. textcolor (normbotcolor);
  1201. write  (usr,':           │');
  1202. textcolor (outlockcolor);
  1203. write  (usr,'Sysop Mail  ');
  1204. textcolor (normbotcolor);
  1205. writeln(usr,':           │');
  1206. writeln(usr,'├────────────────────────┴────────────┬───────────┴────────────────────────┤');
  1207. write  (usr,'│ ');
  1208. textcolor (outlockcolor);
  1209. write  (usr,'Last Caller');
  1210. textcolor (normbotcolor);
  1211. write  (usr,':                        │');
  1212. textcolor (outlockcolor);
  1213. write  (usr,'F1   ');
  1214. textcolor (normbotcolor);
  1215. write  (usr,': ');
  1216. if outlockcolor>8 then
  1217. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1218. write  (usr,'Force Net Call               ');
  1219. textcolor (normbotcolor);
  1220. writeln(usr,'│');
  1221. write  (usr,'├─────────────────────────────────────┤');
  1222. textcolor (outlockcolor);
  1223. write  (usr,'F2   ');
  1224. textcolor (normbotcolor);
  1225. write  (usr,': ');
  1226. if outlockcolor>8 then
  1227. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1228. write  (usr,'Exit FAQ                     ');
  1229. textcolor (normbotcolor);
  1230. writeln(usr,'│');
  1231. write  (usr,'│ ');
  1232. textcolor (outlockcolor);
  1233. write  (usr,'Version');
  1234. textcolor (normbotcolor);
  1235. write  (usr,':                            │');
  1236. textcolor (outlockcolor);
  1237. write  (usr,'F3   ');
  1238. textcolor (normbotcolor);
  1239. write  (usr,': ');
  1240. if outlockcolor>8 then
  1241. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1242. write  (usr,'Send Carrier                 ');
  1243. textcolor (normbotcolor);
  1244. writeln(usr,'│');
  1245. write  (usr,'├─────────────────────────────────────┤');
  1246. textcolor (outlockcolor);
  1247. write  (usr,'F4   ');
  1248. textcolor (normbotcolor);
  1249. write  (usr,': ');
  1250. if outlockcolor>8 then
  1251. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1252. write  (usr,'Send Off Hook                ');
  1253. textcolor (normbotcolor);
  1254. writeln(usr,'│');
  1255. write  (usr,'│ ');
  1256. textcolor (outlockcolor);
  1257. write  (usr,'Net Node');
  1258. textcolor (normbotcolor);
  1259. write  (usr,':                           │');
  1260. textcolor (outlockcolor);
  1261. write  (usr,'F5   ');
  1262. textcolor (normbotcolor);
  1263. write  (usr,': ');
  1264. if outlockcolor>8 then
  1265. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1266. write  (usr,'Run Protocol Setup Program   ');
  1267. textcolor (normbotcolor);
  1268. writeln(usr,'│');
  1269. write  (usr,'├─────────────────────────────────────┤');
  1270. textcolor (outlockcolor);
  1271. write  (usr,'F6   ');
  1272. textcolor (normbotcolor);
  1273. write  (usr,': ');
  1274. if outlockcolor>8 then
  1275. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1276. write  (usr,'Run Setup Program            ');
  1277. textcolor (normbotcolor);
  1278. writeln(usr,'│');
  1279. write  (usr,'│ ');
  1280. textcolor (outlockcolor);
  1281. write  (usr,'Using CelerityNet');
  1282. textcolor (normbotcolor);
  1283. write  (usr,':                  │');
  1284. textcolor (outlockcolor);
  1285. write  (usr,'F7   ');
  1286. textcolor (normbotcolor);
  1287. write  (usr,': ');
  1288. if outlockcolor>8 then
  1289. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1290. write  (usr,'Terminal Program             ');
  1291. textcolor (normbotcolor);
  1292. writeln(usr,'│');
  1293. write  (usr,'├─────────────────────────────────────┤');
  1294. textcolor (outlockcolor);
  1295. write  (usr,'F8   ');
  1296. textcolor (normbotcolor);
  1297. write  (usr,': ');
  1298. if outlockcolor>8 then
  1299. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1300. write  (usr,'Read Feedback                ');
  1301. textcolor (normbotcolor);
  1302. writeln(usr,'│');
  1303. write  (usr,'│');
  1304. textcolor (outlockcolor);
  1305. write  (usr,'                                     ');
  1306. textcolor (normbotcolor);
  1307. write  (usr,'│');
  1308. textcolor (outlockcolor);
  1309. write  (usr,'F9   ');
  1310. textcolor (normbotcolor);
  1311. write  (usr,': ');
  1312. if outlockcolor>8 then
  1313. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1314. write  (usr,'Sysop Functions              ');
  1315. textcolor (normbotcolor);
  1316. writeln(usr,'│');
  1317. write  (usr,'│');
  1318. textcolor (outlockcolor);
  1319. write  (usr,'                                     ');
  1320. textcolor (normbotcolor);
  1321. write  (usr,'│');
  1322. textcolor (outlockcolor);
  1323. write  (usr,'F10  ');
  1324. textcolor (normbotcolor);
  1325. write  (usr,': ');
  1326. if outlockcolor>8 then
  1327. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1328. write  (usr,'Login Local                  ');
  1329. textcolor (normbotcolor);
  1330. writeln(usr,'│');
  1331. write  (usr,'│');
  1332. textcolor (outlockcolor);
  1333. write  (usr,'                                     ');
  1334. textcolor (normbotcolor);
  1335. write  (usr,'│');
  1336. textcolor (outlockcolor);
  1337. write  (usr,'ALT-A');
  1338. textcolor (normbotcolor);
  1339. write  (usr,': ');
  1340. if outlockcolor>8 then
  1341. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1342. write  (usr,'Toggle Chat Status           ');
  1343. textcolor (normbotcolor);
  1344. writeln(usr,'│');
  1345. write  (usr,'│');
  1346. textcolor (outlockcolor);
  1347. write  (usr,'                                     ');
  1348. textcolor (normbotcolor);
  1349. write  (usr,'│');
  1350. textcolor (outlockcolor);
  1351. write  (usr,'ALT-H');
  1352. textcolor (normbotcolor);
  1353. write  (usr,': ');
  1354. if outlockcolor>8 then
  1355. textcolor (outlockcolor-8) else textcolor (outlockcolor);
  1356. write  (usr,'Hang Up Modem                ');
  1357. textcolor (normbotcolor);
  1358. writeln(usr,'│');
  1359. writeln(usr,'├──────────────────────────┬──────────┴──────────────┬─────────────────────┤');
  1360. write  (usr,'│ ');
  1361. textcolor (outlockcolor);
  1362. write  (usr,'Clock');
  1363. textcolor (normbotcolor);
  1364. write  (usr,':                   │');
  1365. textcolor (outlockcolor);
  1366. write  (usr,'Modem');
  1367. textcolor (normbotcolor);
  1368. write  (usr,':                   │');
  1369. textcolor (outlockcolor);
  1370. write  (usr,'Avail');
  1371. textcolor (normbotcolor);
  1372. writeln(usr,':               │');
  1373. writeln(usr,'├──────────────────────────┴─────────────────────────┴─────────────────────┤');
  1374. writeln(usr,'│                                                                          │');
  1375. write  (usr,'└──────────────────────────────────────────────────────────────────────────┘');
  1376.     if interrupted (true) then exit;
  1377.     window (1,1,80,25);
  1378.     textcolor (outlockcolor);
  1379.  if jshutup then begin
  1380.   if length(getenv('JMODEM'))<1 then
  1381.     begin
  1382.     Assign (outf,'SETJ.BAT');
  1383.     rewrite(outf);
  1384.     WriteLn(outf,'cls');
  1385.     WriteLn(outf,'echo                 Telling Jmodem to shut its mouth - please wait');
  1386.     writeln(outf,'SET JMODEM=SHUTUP');
  1387.     WriteLn(outf,'MAIN.BAT');
  1388.     textclose(outf);
  1389.   end;
  1390.  end;
  1391.    {If timeStr(Now)=Bytime then Sysopavail:=TRUE;}
  1392.     if interrupted (true) then exit;
  1393.     writeboardname;
  1394.    {setupmodem;}
  1395.     numsmail:=getnummail(1)+numfeedback;
  1396.     tmp:=getlastcaller;
  1397.    {col1;}
  1398.     gotoxy (17,9);
  1399.     textcolor (normtopcolor);
  1400.     write (usr,copy(tmp,1,23));
  1401.     gotoxy (13,11);
  1402.     textcolor (color1);
  1403.     write (usr,'F');
  1404.     textcolor (color2);
  1405.     write (usr,'A');
  1406.     textcolor (color3);
  1407.     write (usr,'Q ');
  1408.     textcolor (color4);
  1409.     write (usr,copy (ver,1,1));
  1410.     textcolor (color5);
  1411.     write (usr,copy (ver,2,1));
  1412.     textcolor (color6);
  1413.     write (usr,copy (ver,3,1));
  1414.     textcolor (color7);
  1415.     write (usr,copy (ver,4,1)+' ');
  1416.     textcolor (color8);
  1417.     write (usr,copy (date,1,1));
  1418.     textcolor (color9);
  1419.     write (usr,copy (date,2,1));
  1420.     textcolor (color10);
  1421.     write (usr,copy (date,3,1));
  1422.     textcolor (color11);
  1423.     write (usr,copy (date,4,1));
  1424.     textcolor (color12);
  1425.     write (usr,copy (date,5,1));
  1426.     textcolor (color13);
  1427.     write (usr,copy (date,6,1));
  1428.     textcolor (color14);
  1429.     write (usr,copy (date,7,1));
  1430.     textcolor (color15);
  1431.     write (usr,copy (date,8,1));
  1432.     textcolor (normtopcolor);
  1433.     gotoxy (42,4);
  1434.     write (usr,numcallers:0:0);
  1435.     writeavail;
  1436.    {gotoxy(1,7); write(usr,dszlogname);
  1437.     gotoxy(1,8); write(usr,sklog);
  1438.     col2;}
  1439.     gotoxy (18,6);
  1440.     writeln (usr,newcalls);
  1441.     gotoxy (42,6);
  1442.     writeln (usr,newposts);
  1443. {    writeln (usr,numminsused.total:0:0);
  1444.     write (usr,numminsxfer.total:0:0);
  1445.     gotoxy (1,10);}
  1446.     gotoxy (67,6);
  1447.     writeln(usr,newuploads);
  1448.     gotoxy (18,7);
  1449.     writeln(usr,newfeedback);
  1450.     gotoxy (42,7);
  1451.     writeln(usr,newmail);
  1452.     gotoxy (67,7);
  1453.     writeln(usr,numsmail);
  1454.     gotoxy (16,2);
  1455.     writeln(usr,reg.handle);
  1456.     gotoxy (56,2);
  1457.     writeln(usr,strlong(reg.serial));
  1458.     gotoxy(37,22);
  1459.     textcolor (normtopcolor);
  1460.     writeln(usr,'Waiting for Call');
  1461.     end;
  1462.     if usemouse then
  1463.     showmouse;
  1464.     repeat
  1465.       checkday;
  1466.       drawstatus;
  1467.       cnt:=0;
  1468.       if screenblank then begin
  1469.       cursor (false);
  1470.       {for iiii:=1 to 15 do begin
  1471.       gotoxy (10,iiii+1);
  1472.       textcolor (iiii);
  1473.       write (usr,'[Screen Saver ON - Press ALT-B to turn off Screen Saver]');
  1474.       gotoxy (1,iiii+1);
  1475.       delay (100);
  1476.       clreol;
  1477.       end;}
  1478.       end;
  1479.       repeat
  1480. {         while (answerring<1) and (not carrier) and (numchars>0) do begin
  1481.           k:=getchar;
  1482.           case k of
  1483.             '2':phonesringing;
  1484.             '1','3','5':connectcode(k)
  1485.           end
  1486.         end; }
  1487.          cnt:=cnt+1
  1488.       until (cnt>=500) or interrupted (false) or done;
  1489.     until done;
  1490.    end;
  1491.  
  1492. var k:char; time,num:integer;
  1493.     mi:minuterec;
  1494. label exit;
  1495. begin
  1496.   waitforacall:=false;
  1497.   {arq:=false;}
  1498.   doanswer;
  1499.   setparam (usecom,defbaudrate,false);
  1500.   if offcall then sendmodemstr ('~~ATM0H1|',true);
  1501.   setupmodem;
  1502.   if (offcall) or (offlocal) then sendmodemstr ('~~ATH|',true);
  1503.   starttimer (numminsidle);
  1504.   starttimer (blanker);
  1505.   color1:=1;
  1506.   color2:=2;
  1507.   color3:=3;
  1508.   color4:=4;
  1509.   color5:=5;
  1510.   color6:=6;
  1511.   color7:=7;
  1512.   color8:=8;
  1513.   color9:=9;
  1514.   color10:=10;
  1515.   color11:=11;
  1516.   color12:=12;
  1517.   color13:=13;
  1518.   color14:=14;
  1519.   color15:=15;
  1520.   wscount:=0;
  1521.   local:=false;
  1522.   screenblank:=false;
  1523.   clrscr;
  1524.   repeat
  1525.     doanswer;
  1526.     if not carrier Then Begin
  1527.       clearoutput;
  1528.       clearinput;
  1529.     End;
  1530.     mustgetbaud:=true;
  1531.     k:=statusscreen;
  1532.     if carrier then begin
  1533.       receivecall;
  1534.       if carrier then goto exit;
  1535.     end;
  1536.     case ord(k)-128 of
  1537.       48:{if not screenblank then screenblank:=true else}
  1538.          begin
  1539.          screenblank:=false;
  1540.          stoptimer2 (blanker);
  1541.          end;
  1542.       59:if usenet then begin if usemouse then hidemouse; clrscr; NewNetSend; end;
  1543.       60:begin
  1544.         if usemouse then hidemouse;
  1545.     gotoxy(37,22);
  1546.           textcolor (normtopcolor);
  1547.           write(usr,'Exiting FAQ     ');
  1548.            writestatus;
  1549.            exitprog;
  1550.          end;
  1551.       61:begin
  1552.       writestatus;
  1553.       gotoxy(37,22);
  1554.           textcolor (normtopcolor);
  1555.       write(usr,'Modem Carrier On');
  1556.           sendmodemstr('ATA|',true);
  1557.          end;
  1558.       62:begin
  1559.       writestatus;
  1560.       gotoxy(37,22);
  1561.           textcolor (normtopcolor);
  1562.       if not modemoff then write(usr,'Modem Off Hook  ') else
  1563.           write (usr,'Modem On Hook   ');
  1564.           if modemoff then begin
  1565.           sendmodemstr('ATH|',true);
  1566.           modemoff:=false end else begin
  1567.           sendmodemstr('ATH1|',true);
  1568.           modemoff:=true;
  1569.           end
  1570.          end;
  1571.       63:begin
  1572.          if usemouse then hidemouse;
  1573.          cursor (true);
  1574.          Run_Prot_Config;
  1575.          end;
  1576.       64:Begin
  1577.          if usemouse then hidemouse;
  1578.          cursor (true);
  1579.          Run_Config; Readconfig;
  1580.          End;
  1581.       65:begin
  1582.          if usemouse then hidemouse;
  1583.            clrscr;
  1584.            writestatus;
  1585.            ClosePort;
  1586.            cursor (true);
  1587.   ansicolor (7);
  1588.   textcolor (7);
  1589.            halt (121);
  1590.          end;
  1591.       66:begin
  1592.           if usemouse then hidemouse;
  1593.           window (1,1,80,25);
  1594.           clrscr;
  1595.            unum:=lookupuser (sysopname);
  1596.              if unum=0 then begin
  1597.                writeln ('No Sysop Created.');
  1598.                delay (1000);
  1599.               end;
  1600.             readurec;
  1601.            urec.timetoday:=10000;
  1602.            cursor (true);
  1603.        readfeedback;
  1604.        newfeedback:=0;
  1605.           urec.timetoday:=time;
  1606.           writeurec;
  1607.           clrscr;
  1608.           end;
  1609.       67:begin
  1610.           if usemouse then hidemouse;
  1611.           window (1,1,80,25);
  1612.           clrscr;
  1613.            unum:=lookupuser (sysopname);
  1614.              if unum=0 then begin
  1615.                writeln ('No Sysop Created.');
  1616.                delay (1000);
  1617.               end;
  1618.             readurec;
  1619.            urec.timetoday:=10000;
  1620.            cursor (true);
  1621.            mainsysopcommands;
  1622.           urec.timetoday:=time;
  1623.           writeurec;
  1624.           clrscr;
  1625.           end;
  1626.       68:begin
  1627.            if usemouse then hidemouse;
  1628.        dontanswer;
  1629.            modeminlock:=true;
  1630.            modemoutlock:=true;
  1631.            local:=true;
  1632.            online:=false;
  1633.            if (offlocal) and (local) and (not online) then begin
  1634.            sendmodemstr ('~~ATM0H1|',true);
  1635.            end;
  1636.            if newfeedback<>0 then newfeedback:=0;
  1637.            if newuploads<>0 then newuploads:=0;
  1638.            if newcalls<>0 then newcalls:=0;
  1639.            if newposts<>0 then newposts:=0;
  1640.        if newmail<>0 then newmail:=0;
  1641.            writestatus;
  1642.        {setcursor(cursoron);}cursor(true);
  1643.            goto exit
  1644.          end
  1645.     end;
  1646.   until 0=1;
  1647.   exit:
  1648.   if usemouse then hidemouse;
  1649.   textcolor (normbotcolor);
  1650.   window (1,1,80,25);
  1651.   clrscr;
  1652. end;
  1653.  
  1654. begin
  1655. end.
  1656.